<?php

declare(strict_types=1);

namespace App\Model\Message;

use App\Traits\Model\Message\Sms as SmsTraits;
use App\Model\Model;

/**
 * @property int $id 
 * @property string $account 账号
 * @property int $type 账号类型|{"1":"手机号码","2":"邮箱"}
 * @property string $message 信息内容
 * @property string $sign 信息签名
 * @property int $status 发送状态|["待发送","成功","失败"]
 * @property string $send_at 发送成功时间
 * @property int $sms_type 短信类型|{"1":"验证码","2":"营销信息","3":"通知信息"}
 * @property string $code 验证码
 * @property int $scene 场景|{"1":"小程序登录"}
 * @property int $ip IP
 * @property string $error_msg 失败原因
 * @property int $is_verfication 是否验证|["否","是"]
 * @property int $app_id 应用ID
 * @property string $app 应用
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class Sms extends Model
{
    use SmsTraits;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'sms';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'account', 'type', 'message', 'sign', 'status', 'send_at', 'sms_type', 'code', 'scene', 'ip', 'error_msg', 'is_verfication', 'app_id', 'app', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'type' => 'integer', 'status' => 'integer', 'sms_type' => 'integer', 'scene' => 'integer', 'ip' => 'integer', 'is_verfication' => 'integer', 'app_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     * 自动新增
     * @var array|string[]
     */
    public array $insert = [
        'ip',
        'app'
    ];
}
